Skip to content

Fix handling of binary output with output format override #275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

jonasbardino
Copy link
Contributor

@jonasbardino jonasbardino commented Jun 30, 2025

Adjust cgiscriptstub and migwsgi to allow consistent overriding of output_format in the functionality backends.
Reuses the delay_format idea only available in CGI, but generalizes it to use the start output_object entry, which is trivially available both in CGI and WSGI.
Includes refactoring of previously duplicated cgi and wsgi code for output_format parsing and start entry init plus header mangling into a shared xgicore helper in the new mig/lib subdir. Please refer to the included README there for details.
Synchronizes CGI output_format parsing with that in WSGI to use first instead of last entry; probably never an issue but better safe than sorry.

@jonasbardino jonasbardino self-assigned this Jun 30, 2025
@jonasbardino jonasbardino added the bug Something isn't working label Jun 30, 2025
@jonasbardino jonasbardino linked an issue Jun 30, 2025 that may be closed by this pull request
@jonasbardino jonasbardino force-pushed the fix/handling-of-binary-output-with-output-format-override branch from 096bf6d to be248e9 Compare July 1, 2025 05:59
@jonasbardino jonasbardino marked this pull request as ready for review July 1, 2025 06:41
@jonasbardino jonasbardino requested review from a team and albu-diku July 1, 2025 06:41
Copy link
Contributor

@Martin-Rehr Martin-Rehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

`output_format` in the functionality backends.
Reuses the `delay_format` idea only available in CGI, but generalizes it to use
the `start` output_object entry, which is trivially available both in CGI and
WSGI.
Includes preparations for refactoring into a shared helper to refresh output
format but a few differences between CGI and WSGI handling still prevent that
step.
Synchronizes CGI `output_format` parsing with that in WSGI to use first instead
of last entry; probably never an issue but better safe than sorry.
…in cgi and

wsgi core.
Introduces the new `mig/lib/` subdir with a simple `xgicore.py` module in it.
It only contains a few new helper functions refactored from the Xgi cores and
it is clean, linted and unit tested in line with what we previously agreed on
in the dev team. Further modules can be added or migrated there as we proceed
with the brush-up of old code.
…e new

`mig/lib/xgicore.py` and sorted the corresponding new imports as suggested by
_isort_.
Polished `mig/lib/README` a bit.
@jonasbardino jonasbardino force-pushed the fix/handling-of-binary-output-with-output-format-override branch from 158fc82 to 6362ea3 Compare July 2, 2025 08:21
@jonasbardino jonasbardino merged commit 6396dfa into next Jul 2, 2025
7 checks passed
@jonasbardino jonasbardino deleted the fix/handling-of-binary-output-with-output-format-override branch July 2, 2025 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rendering of vgrid/workgroup web files is broken on python3
2 participants